package com.imooc.coupon.feign;

import com.imooc.coupon.exception.CouponException;
import com.imooc.coupon.feign.hystrix.SettlementClientHystrix;
import com.imooc.coupon.vo.CommonResponse;
import com.imooc.coupon.vo.SettlementInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * <h1>优惠卷结算微服务 Feign 接口定义</h1>
 * @Author: crowsjian
 * @Date: 2020/6/20 14:21
 */
@FeignClient(value = "eureka-client-coupon-settlement",fallback = SettlementClientHystrix.class)
public interface SettlementClient {
    /**
     * <h2>优惠卷计算规则</h2>
     * @param settlementInfo
     * @return
     * @throws CouponException
     */
    @RequestMapping(value = "/coupon-settlement/settlement/conpute",method = RequestMethod.POST)
    CommonResponse<SettlementInfo> conputeRule(@RequestBody SettlementInfo settlementInfo)
            throws CouponException;
}
